package com.itheima.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface CheckItemICheckGroupIdMapper {
    //根据检查组id查询检查项id
    @Select("select checkitem_id from t_checkgroup_checkitem  where checkgroup_id=#{id}")
    List<Integer> findCheckItemIdsByCheckGroupId(Integer id);

    //添加检查组和检查项的关联关系
    @Insert("insert into t_checkgroup_checkitem(checkgroup_id,checkitem_id) values(#{id},#{checkitemId})")
    void addCheckGroupAndCheckItem(Integer id, Integer checkitemId);

    //删除检查组和检查项的关联关系
    @Delete("delete from t_checkgroup_checkitem where checkgroup_id= #{id}")
    void delete(Integer id);
}
